package ProxyClasses;

import OriginalClasses.ConcreteSubject;
import OriginalClasses.Subject;

/**
 * Created by DELL
 * Date: 2019/9/28.
 * Time: 14:34
 */
public class Proxy extends Subject {
    ConcreteSubject cs;
    @Override
    public void doSomeWork() {
        System.out.println("Proxy call happening now");
        //lazy initialization
        if(cs == null){
            cs = new ConcreteSubject();
        }else{
            cs.doSomeWork();
        }
    }
}
